package com.isky.visual.system.controller;

import com.isky.visual.result.ResultVo;
import com.isky.visual.system.entity.SystemConfiguration;
import com.isky.visual.system.service.ISystemConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wenjs
 */
@Api(tags = {"系统配置"})
@RestController
@RequestMapping("/system/config")
public class SystemConfigController {

    @Autowired
    private ISystemConfigService iSystemConfigService;


    @GetMapping(value = "/getByCode")
    @ApiOperation("参数配置")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", value = "配置编码 ", required = true, dataType = "String", paramType = "query")
    })
    public ResultVo<SystemConfiguration> getGroupDashboard(@RequestParam(name = "code", required = true) String code) {
        SystemConfiguration systemConfiguration = iSystemConfigService.getByCode(code);
        return ResultVo.success(systemConfiguration);
    }

}
